package com.carmeth.play;

import java.io.File;

import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageButton;
import android.widget.ImageView;

public class Play extends Activity {
	
	private final String CLASS=this.getClass().getSimpleName();

	/** Called when the activity is first created. */
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.main);
		
		Log.d(CLASS,getApplicationContext().getFilesDir().toString());
		
		for(File f:getApplicationContext().getFilesDir().listFiles()){
			Log.d(CLASS,f.getAbsolutePath());
			Log.d(CLASS,f.toURI().toString());
		}

		ImageButton play = (ImageButton) findViewById(R.id.playPauseBtn);
		play.setOnClickListener(player);

//		ImageButton pause = (ImageButton) findViewById(R.id.pauseBtn);
//		pause.setOnClickListener(player);

		ImageButton stop = (ImageButton) findViewById(R.id.stopBtn);
		stop.setOnClickListener(player);

		ImageButton prev = (ImageButton) findViewById(R.id.prevBtn);
		prev.setOnClickListener(player);

		ImageButton next = (ImageButton) findViewById(R.id.nextBtn);
		next.setOnClickListener(player);
	}

	OnClickListener player = new OnClickListener() {
		@Override
		public void onClick(View v) {
			ImageButton change=(ImageButton)v;
			switch (change.getId()) {
			case R.id.playPauseBtn:
				Log.d(CLASS,"PlayPause");

//				if(change.getResources().getIntArray(R.id.playPauseBtn)){
//					change.setImageResource(R.drawable.pause_btn);
//					Log.d(CLASS,"Play");
//				}else if(change.getDrawable().equals(getResources().getDrawable(R.drawable.pause_btn))){
//					change.setImageResource(R.drawable.play_btn);
//					Log.d(CLASS,"Pause");
//				}
				break;
			case R.id.stopBtn:
				Log.d(CLASS,"Stop");
				break;
			case R.id.prevBtn:
				Log.d(CLASS,"Prev");
				break;
			case R.id.nextBtn:
				Log.d(CLASS,"Next");
				break;
			}
		}
	};
}